<?php
$sh_languages['ruby'] = array(
    // State #0
    array(
        array(
            '/\b(?:require)\b/i',
            'sh_preproc',
            -1
        ),
        array(
            '/\b[+-]?(?:(?:0x[a-f0-9]+)|(?:(?:[\d]*\.)?[\d]+(?:[eE][+-]?[\d]+)?))u?(?:(?:int(?:8|16|32|64))|L)?\b/i',
            'sh_number',
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            1
        ),
        array(
            '/\'/i',
            'sh_string',
            2
        ),
        array(
            '/</i',
            'sh_string',
            3
        ),
        array(
            '/\/[^\n]*\//i',
            'sh_regexp',
            -1
        ),
        array(
            '/(%r)(\{(?:\\\\\}|#\{[a-z0-9]+\}|[^}])*\})/i',
            array('sh_symbol', 'sh_regexp'),
            -1
        ),
        array(
            '/\b(?:alias|begin|BEGIN|break|case|defined|do|else|elsif|end|END|ensure|for|if|in|include|loop|next|raise|redo|rescue|retry|return|super|then|undef|unless|until|when|while|yield|false|nil|self|true|__FILE__|__LINE__|and|not|or|def|class|module|catch|fail|load|throw)\b/i',
            'sh_keyword',
            -1
        ),
        array(
            '/(?:^\=begin)/i',
            'sh_comment',
            4
        ),
        array(
            '/(?:\$[#]?|@@|@)(?:[a-z0-9_]+|\'|\"|\/)/i',
            'sh_type',
            -1
        ),
        array(
            '/[a-z0-9]+(?:\?|!)/i',
            'sh_normal',
            -1
        ),
        array(
            '/~|!|%|\^|\*|\(|\)|-|\+|=|\[|\]|\\\\|:|;|,|\.|\/|\?|&|<|>|\|/i',
            'sh_symbol',
            -1
        ),
        array(
            '/(#)(\{)/i',
            array('sh_symbol', 'sh_cbracket'),
            -1
        ),
        array(
            '/#/i',
            'sh_comment',
            5
        ),
        array(
            '/\{|\}/i',
            'sh_cbracket',
            -1
        )
    ),
    // State #1
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/\\\\(?:\\\\|")/i',
            null,
            -1
        ),
        array(
            '/"/i',
            'sh_string',
            -2
        )
    ),
    // State #2
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/\\\\(?:\\\\|\')/i',
            null,
            -1
        ),
        array(
            '/\'/i',
            'sh_string',
            -2
        )
    ),
    // State #3
    array(
        array(
            '/$/i',
            null,
            -2
        ),
        array(
            '/>/i',
            'sh_string',
            -2
        )
    ),
    // State #4
    array(
        array(
            '/^(?:\=end)/i',
            'sh_comment',
            -2
        )
    ),
    // State #5
    array(
        array(
            '/$/i',
            null,
            -2
        )
    )
);
